package cn.saas.wanandroiddemo;

import android.content.Intent;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;

import cn.saas.wanandroiddemo.base.BaseActivity;


/**
 * @author : admin
 * @Title :
 * @date : 2022/3/10 17:37
 */
public class SplashActivity extends BaseActivity {

    private AlphaAnimation alphaAnimation;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_splash;
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void start() {

    }


    @Override
    protected void initView() {
        alphaAnimation = new AlphaAnimation(0.3f, 1.0f);
        alphaAnimation.setDuration(2000);
        alphaAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                jumpToMain();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
//        layout_splash
    }

    private void jumpToMain() {
        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
        finish();
        overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
    }

    @Override
    protected void initData() {

    }

}
